package com.xiyuan.smartutils.template.engine.expression.primitive;


import com.xiyuan.smartutils.template.engine.VariableMap;
import com.xiyuan.smartutils.template.engine.exception.ExpressionException;

/**
 * 布尔原型，true/false
 * @version v1.0.0 @author lgz 2020年11月1日 新建与整理
 */
public class _Boolean extends Primitive
{
    private static final long serialVersionUID = 1L;
    private final boolean value;
    public _Boolean(String path,int line, int column, boolean value)
    {
        super(path, line, column);
        this.value = value;;
    }
    
    @Override
    public int getType()
    {
        return BOOLEAN;
    }
    
    @Override
    public Object build(VariableMap variableMap) throws ExpressionException
    {
        return value;
    }
    
    public boolean getValue()
    {
        return value;
    }
    @Override
    public String toString()
    {
        return String.valueOf(value);
    }
}
